﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Extensions
{
	public static class StringExtensions
	{
		public static Double ToDouble(this String str, Double def)
		{
			if (String.IsNullOrWhiteSpace(str))
				return def;

			double res;
			return Double.TryParse(str, out res) ? res : def;
		}
	}
}
